package com.jiangkang.example.web;

import com.jiangkang.example.service.IUserService;
import com.jiangkang.example.dto.GlobalResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * @author fang
 * @describe 用户相关控制层
 * @date 2019-03-11
 */
@RestController
@RequestMapping(value = "/userbg-two")
@Slf4j
public class UserController {

	@Autowired
	private IUserService userService;


	//http://localhost:20002/userbg-two/queryUserByStudentId?studentId=19SL8T6
	@GetMapping(value = "/queryUserByStudentId", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	public GlobalResponse queryUserByStudentId(@RequestParam("studentId") String studentId) {
		GlobalResponse res = new GlobalResponse();
		res.setStatus("1");
		res.setResult(userService.queryUserByStudentId(studentId));
		return res;
	}



}
